package com.ztjava.ask.validator;

import com.jfinal.core.Controller;
import com.ztjava.core.Constant;
import com.ztjava.core.base.BaseValidator;

public class AddQuestionValidator extends BaseValidator{

	@Override
	protected void validate(Controller c) {
		setShortCircuit(true);
		validateInteger("catalog_id",Constant.MESSAGE, "请选择问分类");
		validateRequired("title", Constant.MESSAGE, "请输入问题标题！");
		validateString("title", 10, 100, Constant.MESSAGE, "问题标题必须10-100个字符！");
		validateRequired("content", Constant.MESSAGE, "请输入问题描述！");
		validateString("content", 10,500, Constant.MESSAGE, "问题内容必须10-500个字符！");
	}

}
